package com.yootk.action;

import com.yootk.action.abs.AbstractAction;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/pages/user/*")
@SessionAttributes({"user","role"})
public class UserAction extends AbstractAction {
    @GetMapping("get")
    public String get(ModelMap map){
        map.addAttribute("user", Map.of("yootk","com.yootk","sun","sunjava")) ;
        map.addAttribute("role", List.of("company","dept","emp")) ;
        return "/pages/user/login.jsp" ;
    }
}
